package org.dtrd.modules.shop.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.config.pay.OrderUtil;
import org.dtrd.modules.shop.entity.po.DtrdEntShcRdProduct;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author sun
 * @since 2022-07-23
 */
@Getter
@Setter
@ApiModel(value = "列表信息", description = "")
public class ProductListInfo {

    private Integer dataId;


    @ApiModelProperty("1-血糖仪，2-试纸，3-服务")
    private Integer productCategory;

    @ApiModelProperty("商品名称")
    private String productName;

    @ApiModelProperty("商品价格")
    private Integer productPrice;

    @ApiModelProperty("商品折扣价")
    private Integer productDiscountPrice;

    @ApiModelProperty("商品会员")
    private Integer productVipPrice;

    @ApiModelProperty("商品价格")
    private String productFormatPrice;

    @ApiModelProperty("商品折扣价")
    private String productFormatDiscountPrice;

    @ApiModelProperty("商品折扣价")
    private String productFormatVipPrice;

    @ApiModelProperty("商品信息")
    private String productInfo;

    @ApiModelProperty("商品缩略图")
    private String productThumb;

    @ApiModelProperty("商品入口图")
    private String productEnterPic;

    @ApiModelProperty("商品滚动图")
    private String productBanner;

    @ApiModelProperty("商品详情图")
    private String productDetailPic;

    @ApiModelProperty("商品对应服务包ID")
    private Integer productServiceId;

    @ApiModelProperty("排序")
    private Integer productSort;

    @ApiModelProperty("商品状态：0-下架，1-上架")
    private Integer productStatus;

    @ApiModelProperty("库存")
    private Integer productStock;

    @ApiModelProperty("规格")
    private String productSku;

    @ApiModelProperty("单位")
    private String productUnit;

    @ApiModelProperty("标签")
    private String productTag;

    @ApiModelProperty("热销")
    private Integer productIsHot;

    @ApiModelProperty("热销推荐时间")
    private Date productPushTime;


    public ProductListInfo (DtrdEntShcRdProduct po) {
        dataId = po.getDataId();
        productCategory = po.getProductCategory();
        productName = po.getProductName();
        productPrice = po.getProductPrice();
        productFormatPrice = OrderUtil.changeF2Y((long)po.getProductPrice());
        productDiscountPrice = po.getProductDiscountPrice();
        productFormatDiscountPrice = OrderUtil.changeF2Y((long)po.getProductDiscountPrice());
        productVipPrice = po.getProductVipPrice();
        productFormatVipPrice = po.getProductVipPrice() != null ? OrderUtil.changeF2Y((long)po.getProductVipPrice()) : "";
        productInfo = po.getProductInfo();
        productThumb = po.getProductThumb();
        productEnterPic = po.getProductEnterPic();
        productBanner = po.getProductBanner();
        productDetailPic = po.getProductDetailPic();
        productServiceId = po.getProductServiceId();
        productSort = po.getProductSort();
        productStatus = po.getProductStatus();
        productStock = po.getProductStock();
        productSku = po.getProductSku();
        productUnit = po.getProductUnit();
        productTag = po.getProductTag();
        productIsHot = po.getProductIsHot();
        productPushTime = po.getProductPushTime();
    }
}
